package colin.spring.boot.sample.rmi.server;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.rmi.RmiServiceExporter;

import colin.spring.boot.sample.rmi.service.RMIUserManageService;

@Configuration
public class RMIServerConfig {

	@Autowired
	private RMIUserManageService userManageService;

	@Bean(name = "userRmiServiceExport")
	public RmiServiceExporter initRmiServiceExport() {
		RmiServiceExporter serviceExport = new RmiServiceExporter();
		serviceExport.setService(userManageService);
		serviceExport.setServiceInterface(RMIUserManageService.class);
		serviceExport.setServiceName("userManageServiceRmi");
		return serviceExport;
	}
}
